// To parse this JSON data, do
//
//     final newsDetailsData = newsDetailsDataFromJson(jsonString);

import 'dart:convert';

NewsDetailsData newsDetailsDataFromJson(String str) =>
    NewsDetailsData.fromJson(json.decode(str));

String newsDetailsDataToJson(NewsDetailsData data) =>
    json.encode(data.toJson());

class NewsDetailsData {
  NewsDetailsData({
    this.id,
    this.fileUrls,
    this.loc,
    this.kwdWord,
    this.per,
    this.audit,
    this.agentsource,
    this.source,
    this.link,
    this.content,
    this.bodyHtml,
    this.title,
    this.date,
    this.description,
    this.org,
    this.usersLike,
    this.newsDetailsDataId,
    this.comments,
  });

  String id;
  List<dynamic> fileUrls;
  List<String> loc;
  List<String> kwdWord;
  List<String> per;
  int audit;
  String agentsource;
  String source;
  String link;
  String content;
  String bodyHtml;
  String title;
  String date;
  String description;
  String org;
  List<String> usersLike;
  String newsDetailsDataId;
  int comments;

  factory NewsDetailsData.fromJson(Map<String, dynamic> json) =>
      NewsDetailsData(
        id: json["_id"],
        fileUrls: List<dynamic>.from(json["file_urls"].map((x) => x)),
        loc: List<String>.from(json["LOC"].map((x) => x)),
        kwdWord: List<String>.from(json["kwd_word"].map((x) => x)),
        per: List<String>.from(json["PER"].map((x) => x)),
        audit: json["audit"],
        agentsource: json["agentsource"],
        source: json["source"],
        link: json["link"],
        content: json["content"],
        bodyHtml: json["body_html"],
        title: json["title"],
        date: json["date"],
        description: json["description"],
        org: json["ORG"],
        usersLike: json["users_like"] != null
            ? List<String>.from(json["users_like"].map((x) => x))
            : [],
        newsDetailsDataId: json["id"],
        comments: json["comments"],
      );

  Map<String, dynamic> toJson() => {
        "_id": id,
        "file_urls": List<dynamic>.from(fileUrls.map((x) => x)),
        "LOC": List<dynamic>.from(loc.map((x) => x)),
        "kwd_word": List<dynamic>.from(kwdWord.map((x) => x)),
        "PER": List<dynamic>.from(per.map((x) => x)),
        "audit": audit,
        "agentsource": agentsource,
        "source": source,
        "link": link,
        "content": content,
        "body_html": bodyHtml,
        "title": title,
        "date": date,
        "description": description,
        "ORG": org,
        "users_like": List<dynamic>.from(usersLike.map((x) => x)),
        "id": newsDetailsDataId,
        "comments": comments,
      };
}
